package com.example.controller;


import com.example.entity.User;
import com.example.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
@Slf4j
public class UsersController {
    @Autowired
    UserMapper userMapper;

    @GetMapping("/details")
    public String detail(Model model){
        User user=new User();
        model.addAttribute("user",user);
        List<User> list= userMapper.findBll();
        model.addAttribute("list",list);
        return "thy";
    }

}
